#include <stdio.h>
#include <pthread.h>

void *thread_func(void *ptr)
{
	printf("thread_func...[%lu]\n", pthread_self());
	sleep(10);
	printf("thread_func terminating...[%lu]\n", pthread_self());
}

int main(void)
{
	pthread_t tid;
	int ret;

	pthread_create(&tid, NULL, thread_func, NULL);

	printf("created thread done...\n");
	sleep(1);
	if ((ret = pthread_tryjoin_np(tid, NULL)) != 0) {
		printf("thread is still running...\n");
	}
	sleep(1);

	return 0;
}
